package com.yuedao.sender.model1;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * Created with IntelliJ IDEA
 * User: z
 * DATE: 2018/8/20
 * TIME: 2018-08-20
 * Description:
 */
@Entity
@Table(name = "ydx_user_voucher")
public class UserVoucherEntity {
    private int id;
    private int userId;
    private int vouchId;
    private Timestamp getTime;
    private Timestamp usedTime;
    private Integer orderId;

    //追加字段
    private Double discountValue;
    private Integer getFromUserId;
    private String GUID;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user_id")
    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "vouch_id")
    public int getVouchId() {
        return vouchId;
    }

    public void setVouchId(int vouchId) {
        this.vouchId = vouchId;
    }

    @Basic
    @Column(name = "get_time")
    public Timestamp getGetTime() {
        return getTime;
    }

    public void setGetTime(Timestamp getTime) {
        this.getTime = getTime;
    }

    @Basic
    @Column(name = "used_time")
    public Timestamp getUsedTime() {
        return usedTime;
    }

    public void setUsedTime(Timestamp usedTime) {
        this.usedTime = usedTime;
    }

    @Basic
    @Column(name = "order_id")
    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserVoucherEntity that = (UserVoucherEntity) o;
        return id == that.id &&
                userId == that.userId &&
                vouchId == that.vouchId &&
                Objects.equals(getTime, that.getTime) &&
                Objects.equals(usedTime, that.usedTime) &&
                Objects.equals(orderId, that.orderId);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, userId, vouchId, getTime, usedTime, orderId);
    }


    @Basic
    @Column(name = "discount_value")
    public Double getDiscountValue() {
        return discountValue;
    }

    public void setDiscountValue(Double discountValue) {
        this.discountValue = discountValue;
    }

    @Basic
    @Column(name = "get_from_user_id")
    public Integer getGetFromUserId() {
        return getFromUserId;
    }

    public void setGetFromUserId(Integer getFromUserId) {
        this.getFromUserId = getFromUserId;
    }




    @Basic
    @Column(name = "GUID")
    public String getGUID() {
        return GUID;
    }

    public void setGUID(String GUID) {
        this.GUID = GUID;
    }




}
